package ca.uguu.gamelib.libgdx.structures;

public class BoundedFloat {
	protected float value = Float.MAX_VALUE;
	protected float max = Float.MAX_VALUE;

	public BoundedFloat(){
	}
	public BoundedFloat(float value){
		this.value = value;
	}
	
	public void setMax(float limit){
		this.max = limit;
		this.value = Math.min(limit, this.value);
	}
	public float get(){
		return this.value;
	}
	public void adjust(float delta){
		this.value = Math.max(0, Math.min(this.max, this.value + delta));
	}
}
